import 'package:get/get.dart';
import 'package:lx_widgets_library/enum/theme_color_enum.dart';

import 'utils/share_preferences_util.dart';

// 插件类
class LxWidgetsLibrary {
  // 初始化
  static Future<void> initialize(ThemeColorType colorType) async {
    // 颜色服务
    Get.put(LxWidgetsLibraryService());

    // 缓存服务
    await Get.putAsync(() async => SharedPreferencesService().init());

    LxWidgetsLibraryService.to.colorType = colorType;
  }
}

// 插件服务
class LxWidgetsLibraryService extends GetxService {
  // 数据库服务
  static LxWidgetsLibraryService get to => Get.find();
  // 主题色类型
  ThemeColorType colorType = ThemeColorType.inmotion;
}
